<template>
  <div class="backPrev">
    <span @click="clickBack"><i class="iconfont icon-fanhui" ></i> </span>
  </div>
</template>

<script>
  export default {
    name: 'back-prev',
    props: {
      isBack: {
        type: Boolean,
        default: false
      }
    },
    methods: {
      clickBack() {
        if (this.isBack) {
          this.$emit('clickBackBtn')
        } else {
          history.go(-1)
        }
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .backPrev {
    position: relative;
    width: 100%;
    height: 100%;
    & span {
      position: fixed;
      top: .75rem;
      left: .75rem;
      z-index: 99;
      background-color: rgba(0, 0, 0, .3);
      border-radius: 1rem;
      width: 2rem;
      height: 2rem;
      line-height:2rem;
      text-align: center;
      & .icon-fanhui {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 1.5rem;
        color: #FFFFFF;
      }
    }
  }

</style>
